import { mapActions } from 'vuex'
const ACTION_PREFIX = module.id; // 设置action前缀确保type的唯一性

export const setMallHomeData = `${ACTION_PREFIX}/setMallHomeData`;
export const setMallDetailData = `${ACTION_PREFIX}/setMallDetailData`;
export const setMallCommentData = `${ACTION_PREFIX}/setMallCommentData`;

// export const mutations = mapMutations({
// 	setMallHomeData: setMallHomeData,
// })
//
export const LOAD_MALL_HOME_DATA = `${ACTION_PREFIX}/LOAD_MALL_HOME_DATA`;
export const LOAD_MALL_DETAIL_DATA = `${ACTION_PREFIX}/LOAD_MALL_DETAIL_DATA`;
export const INSERT_PRODUCT_SHARE = `${ACTION_PREFIX}/INSERT_PRODUCT_SHARE`;
//
export const GET_CONFIRM_ORDER_DATA = `${ACTION_PREFIX}/GET_CONFIRM_ORDER_DATA`;
export const INSERT_ORDER_TO_SERVICE = `${ACTION_PREFIX}/INSERT_ORDER_TO_SERVICE`;
export const PAY_ORDER = `${ACTION_PREFIX}/PAY_ORDER`;
//
export const LOAD_MALL_COMMENT_DATA = `${ACTION_PREFIX}/LOAD_MALL_COMMENT_DATA`;
export const GET_COMMENT_DETAIL = `${ACTION_PREFIX}/GET_COMMENT_DETAIL`;
export const GET_SHOP_COMMENT_REPLY_LIST = `${ACTION_PREFIX}/GET_SHOP_COMMENT_REPLY_LIST`;
export const DELETE_SHOP_COMMENT = `${ACTION_PREFIX}/DELETE_SHOP_COMMENT`;
export const INSERT_SHOP_COMMENT_REPLY = `${ACTION_PREFIX}/INSERT_SHOP_COMMENT_REPLY`; // 回复评论及回复评论下的回复
export const DELETE_SHOP_COMMENT_REPLY = `${ACTION_PREFIX}/DELETE_SHOP_COMMENT_REPLY`;
export const UPDATE_LIKE_COMMENT = `${ACTION_PREFIX}/UPDATE_LIKE_COMMENT`;
export const UPDATE_LIKE_COMMENT_REPLY = `${ACTION_PREFIX}/UPDATE_LIKE_COMMENT_REPLY`;

export default mapActions({
	loadMallHomeData: LOAD_MALL_HOME_DATA,
	loadMallDetailData: LOAD_MALL_DETAIL_DATA,
	insertProductShare: INSERT_PRODUCT_SHARE,
	//
	getConfirmOrderData: GET_CONFIRM_ORDER_DATA,
	insertOrderToService: INSERT_ORDER_TO_SERVICE,
	payOrder: PAY_ORDER,
	//
	loadMallCommentData: LOAD_MALL_COMMENT_DATA,
	getCommentDetail: GET_COMMENT_DETAIL,
	getShopCommentReplyList: GET_SHOP_COMMENT_REPLY_LIST,
	deleteShopComment: DELETE_SHOP_COMMENT,
	insertShopCommentReply: INSERT_SHOP_COMMENT_REPLY,
	deleteShopCommentReply: DELETE_SHOP_COMMENT_REPLY,
	updateLikeComment: UPDATE_LIKE_COMMENT,
	updateLikeCommentReply: UPDATE_LIKE_COMMENT_REPLY,
})